
	
/*
 * 自动计算表单数据
 */
function calFormItem() {
    var domForm = $('#' + window.formObj.c.id_form);
    //其他绩效
	//应发工资 = 基本底薪+岗位薪资+绩效薪资+交通补贴+餐饮补贴+岗位提奖+季度提奖+年终奖-考勤绩效+其他绩效
	var basicSalary = parseFloat(domForm.find('input[name="basicSalary"]').val()); // 基本底薪
	var positionSalary = parseFloat(domForm.find('input[name="positionSalary"]').val()); // 岗位薪资
	var performanceSalary = parseFloat(domForm.find('input[name="performanceSalary"]').val()); // 绩效薪资
	var transSubsidy = parseFloat(domForm.find('input[name="transSubsidy"]').val()); // 交通补贴
	var cateringSubsidy = parseFloat(domForm.find('input[name="cateringSubsidy"]').val()); // 餐饮补贴
	var jobPromotion = parseFloat(domForm.find('input[name="jobPromotion"]').val()); // 岗位提奖
	var quarterBonus = parseFloat(domForm.find('input[name="quarterBonus"]').val()); // 季度提奖
	var yearEndBonus = parseFloat(domForm.find('input[name="yearEndBonus"]').val()); // 年终奖
	var attendancePerformance = 0-parseFloat(domForm.find('input[name="attendancePerformance"]').val()); // 考勤绩效
	var otherPerformance = parseFloat(domForm.find('input[name="otherPerformance"]').val()); // 其他绩效
	var otherCost = parseFloat(domForm.find('input[name="otherCost"]').val()); // 其他费用

	if((basicSalary || basicSalary==0) && (positionSalary || positionSalary==0) && (performanceSalary || performanceSalary==0)
		&& (transSubsidy|| transSubsidy==0) && (cateringSubsidy || cateringSubsidy==0)
		&& (jobPromotion || jobPromotion==0) && (quarterBonus || quarterBonus==0) && (yearEndBonus || yearEndBonus==0)
		&& (attendancePerformance || attendancePerformance==0)){
		var count = basicSalary+positionSalary+performanceSalary+transSubsidy+cateringSubsidy+jobPromotion
			+quarterBonus+yearEndBonus-attendancePerformance;
		domForm.find('input[name="wagesPay"]').val(count.toFixed(2));

		//个税收入=应发工资+其他费用
		domForm.find('input[name="taxPaySlip"]').val(count.toFixed(2));
		if((otherCost || otherCost==0)){
			//个税收入=应发工资+其他费用
			domForm.find('input[name="taxPaySlip"]').val((count+otherCost).toFixed(2));
		}
	}
	if((basicSalary || basicSalary==0) && (positionSalary || positionSalary==0) && (performanceSalary || performanceSalary==0)
		&& (transSubsidy|| transSubsidy==0) && (cateringSubsidy || cateringSubsidy==0)
		&& (jobPromotion || jobPromotion==0) && (quarterBonus || quarterBonus==0) && (yearEndBonus || yearEndBonus==0)
		&& (attendancePerformance || attendancePerformance==0) && (otherPerformance|| otherPerformance==0)){
		var count = basicSalary+positionSalary+performanceSalary+transSubsidy+cateringSubsidy+jobPromotion
			+quarterBonus+yearEndBonus-attendancePerformance+otherPerformance;
		domForm.find('input[name="wagesPay"]').val(count.toFixed(2));

		//个税收入=应发工资+其他费用
		domForm.find('input[name="taxPaySlip"]').val(count.toFixed(2));
		if((otherCost || otherCost==0)){
			//个税收入=应发工资+其他费用
			domForm.find('input[name="taxPaySlip"]').val((count+otherCost).toFixed(2));
		}
	}


	//其他费用
	//应付工资 = 应发工资-养老保险（个人）-失业保险（个人）-医疗保险（个人）-公积金（个人）+其他费用
	var wagesPay = parseFloat(domForm.find('input[name="wagesPay"]').val()); // 应发工资
	var retirementPersonal = parseFloat(domForm.find('input[name="retirementPersonal"]').val()); // 养老保险（个人）
	var loseWorkPersonal = parseFloat(domForm.find('input[name="loseWorkPersonal"]').val()); // 失业保险（个人）
	var healthPersonal = parseFloat(domForm.find('input[name="healthPersonal"]').val()); // 医疗保险（个人）
	var accumulationFundPersonal = parseFloat(domForm.find('input[name="accumulationFundPersonal"]').val()); // 公积金（个人）

	if((wagesPay || wagesPay==0) && (retirementPersonal || retirementPersonal==0) && (loseWorkPersonal || loseWorkPersonal==0)
		&& (healthPersonal || healthPersonal==0) && (accumulationFundPersonal || accumulationFundPersonal==0)){
		var count = wagesPay-retirementPersonal-loseWorkPersonal-healthPersonal-accumulationFundPersonal;
		domForm.find('input[name="needPaySlip"]').val(count.toFixed(2));
	}
	if((wagesPay || wagesPay==0) && (retirementPersonal || retirementPersonal==0) && (loseWorkPersonal || loseWorkPersonal==0)
		&& (healthPersonal || healthPersonal==0) && (accumulationFundPersonal || accumulationFundPersonal==0) && (otherCost || otherCost==0)){
		var count = wagesPay-retirementPersonal-loseWorkPersonal-healthPersonal-accumulationFundPersonal+otherCost;
		domForm.find('input[name="needPaySlip"]').val(count.toFixed(2));
	}

}